/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.deib.se2.meteocal.business.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotNull;

@Entity(name="INVITATIONS")
public class Invitation implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Id
    @NotNull
    private Long id;
    
    private boolean status;
    
    //invitation refers to one user invited
    @ManyToOne
    @JoinColumn(name="userInvited", referencedColumnName="email")
    private User userInvited;
    
    //invitation refers to one event from which originates
    @ManyToOne
    @JoinColumn(name="referingEvent", referencedColumnName="id")
    private Event referingEvent;
    
    //invitation has one notification
    @OneToOne
    @JoinColumn(name = "notification_id", referencedColumnName = "id")
    private Notification notification_id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the status
     */
    public boolean isStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(boolean status) {
        this.status = status;
    }

    /**
     * @return the userInvited
     */
    public User getUserInvited() {
        return userInvited;
    }

    /**
     * @param userInvited the userInvited to set
     */
    public void setUserInvited(User userInvited) {
        this.userInvited = userInvited;
    }

    /**
     * @return the referingEvent
     */
    public Event getReferingEvent() {
        return referingEvent;
    }

    /**
     * @param referingEvent the referingEvent to set
     */
    public void setReferingEvent(Event referingEvent) {
        this.referingEvent = referingEvent;
    }

    /**
     * @return the notification_id
     */
    public Notification getNotification_id() {
        return notification_id;
    }

    /**
     * @param notification_id the notification_id to set
     */
    public void setNotification_id(Notification notification_id) {
        this.notification_id = notification_id;
    }
}
